
/*
 * Copyright 2009, Center for Advanced Information Systems,Nanyang Technological University
 *
 * File name: Vertex.java
 *
 * Abstract: The vertex structure in query graph
 *
 * Current Version:      0.1
 * Auther:               Jin Changjiu
 * Modified Date:        Jun.16,2009
 *
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gblend.frequentindex;

import java.util.Vector;

/**
 *
 * @author cjjin
 */
public class Vertex {

    private String label = null;
    private int num = 0;
    private int id = 0;
    private int qid = 0;
    private int degree = 0;
    private String strNeighbor = null;
    private Vector<Integer> Succ = new Vector<Integer>();
    private Vector<Integer> Pred = new Vector<Integer>();
    //Don't know for what, similarity search?
    private Vector<Integer> Out = new Vector<Integer>();
    private Vector<Integer> In = new Vector<Integer>();
    private boolean isVisited;
    //FOR LARGE GRAPh
    private int realdegree = 0;

    public void setLabel(String lab) {
        label = lab;
    }

    public String getLabel() {
        return label;
    }

    public void setNumber(int number) {
        num = number;
    }

    public int getNumber() {
        return num;
    }

    public void setId(int nodeid) {
        id = nodeid;
    }

    public int getId() {
        return id;
    }

    public void setQId(int nodeid) {
        qid = nodeid;
    }

    public int getQId() {
        return qid;
    }

    public void setDegree() {
        degree++;
    }

    public void setDegree(int d) {
        degree = d;
    }

    public int getDegree() {
        return degree;
    }

    public void setNeighbor(String neighbor) {
        strNeighbor = neighbor;
    }

    public String getNeighbor() {
        return strNeighbor;
    }

    public void setSucc(int node) {
        Succ.addElement(node);
    }

    public Vector<Integer> getSucc() {
        return Succ;
    }

    public void setPred(int node) {
        Pred.addElement(node);
    }

    public Vector<Integer> getPred() {
        return Pred;
    }

    public void setM(int node) {
        Out.addElement(node);
    }

    public Vector<Integer> getM() {
        return Out;
    }

    public void setIn(int node) {
        In.addElement(node);
    }

    public Vector<Integer> getIn() {
        return In;
    }

    public void visit() {

        isVisited = true;

    }

    public void clean() {
        isVisited = false;
    }

    public boolean isVisited() {
        return isVisited;
    }

    //FOR LARGE GRAPH
    public int getRealDegree() {
        return realdegree;
    }

    public void setRealDegree(int rd) {
        if (rd >= 0) {
            realdegree = rd;
        }
    }
}
